<?php 
$isDenyVote = false;
if(time() < mktime(0, 0, 1, 3, 1, 2013) || time() > mktime(0, 0, 1, 4, 2, 2013)){
    $isDenyVote = true;
} ?>
<div style="float:left;clear:both;width:810px;min-height:665px;background-color:#e7e7e7;">
    <div style="float:left;clear:both;width:100%;padding-left:20px;">
        
        <?php foreach ($view->newcomments as $comments) { ?>
            <?php foreach ($comments as $c) { ?>
                <div class="photos"<?php if($isDenyVote) { ?> style="height: 170px;background-image: url(../templates/downhilltravel/html/images/frame-novote.png);"<?php } ?>>
                    <a href="javascript:facebooktab.showLikeLightbox(<?php echo $c['data_id']; ?>);" title="<?php echo $c['name'];?>"> 
                        <div class="images" style="height: 120px; overflow: hidden; border: 3px solid rgb(255, 255, 255); width: 129px; margin-left: 18px; margin-top: 15px;">
                        <img src="http://graph.facebook.com/<?php echo $c['facebook_user_id'];?>/picture/?type=large" width="129"  class="">
                        </div>
                    </a> 
                    <?php if(!$isDenyVote) { ?>
                    <div id="like-area-<?php echo $c['data_id']; ?>">
                    <?php if(!$view->isEndOfContest) { ?>
                        <?php if ($view->isLogined && ($c['is_liked'] > 0)) { ?>
                                    <a href="javascript:contestapp.unlikecomment(<?php echo $c['data_id']; ?>)">
                                        <img src="<?php echo $view->config['template_url'];?>html/images/voted.png" width="112" height="37" class="voteimages">
                                    </a>
                        <?php } else { ?>
                                    <a href="javascript:contestapp.likecomment(<?php echo $c['data_id']; ?>)">
                                        <img src="<?php echo $view->config['template_url'];?>html/images/vote.png" width="112" height="37" class="voteimages">
                                    </a>
                        <?php } ?>  
                    <?php } else { ?>  
                        <a href="javascript:contestapp.unlikecomment(<?php echo $c['data_id']; ?>)">
                            <img src="<?php echo $view->config['template_url'];?>html/images/voted.png" width="112" height="37" class="voteimages">
                        </a>
                    <?php } ?>
                    </div>
                    <?php } ?>
                </div>
            <?php } ?>
        <?php } ?>
        
    </div>
</div>

<div style="float:left;clear:both;width:810px;min-height:46px; height: 46px;background-color:#b41b20;">
    <div style="float:left;clear:both;margin:5px 0  0 693px" >        
        <?php if($view->pagination['numberOfPage'] > 1){ ?>
        
            <?php for($i = 1; $i <= $view->pagination['numberOfPage'];$i++){ ?>
                <div class="pages">
                    <a href="?action=vote&p=<?php echo $i;?>" <?php if($view->pagination['currentPage'] == $i){ echo ' class="curr2"'; }?>><?php echo $i;?></a>
                </div>
            <?php } ?>                
        <?php } ?>                          
    </div>
    
    <div style="margin: 14px auto 0px; width: 300px;">
       <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode($view->config['facebooktab_share_url']); ?>&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:20px;vertical-align: middle;" allowTransparency="true"></iframe>                                            
       <!-- Place this tag where you want the +1 button to render. -->
       <div style="vertical-align:middle;display: inline-block;margin-left: -10px;">
           <div class="g-plusone" data-size="medium" data-href="<?php echo $view->config['facebooktab_share_url']; ?>"></div>
       </div>     
       <div style="vertical-align:middle;display: inline-block;margin-left: -20px;">
        <a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php echo $view->config['facebooktab_share_url']; ?>">Tweet</a>
       </div>
        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    <!-- Place this tag after the last +1 button tag. -->
    <script type="text/javascript">
      window.___gcfg = {lang: 'no'};

      (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      })();
    </script>
    </div>
    
</div>

<?php if($view->app_data) {?>
<script type="text/javascript">
    facebooktab.showLikeLightbox(<?php echo $view->app_data;?>);
</script>
<?php } ?>

<script type="text/javascript">
    contestapp.images.unlike = "<?php echo $view->config['template_url'];?>html/images/voted.png";
</script>